<?php 
$i=0;
$modelAlias = array_pop(explode('.',$model));
?>
<?php if(!isset($addEffects)){?>
<h3><?php echo __("Comments")?>(<?php echo count($comments)?>)</h3>
<?php }else{
	echo $html->link(sprintf(__("Comments (%d)"),count($comments)),'#',array("onclick"=>"\$('#comment_content').toggle();return false;"));
	echo "<br />";
}	
?>
<div id="comment_content">	
<?php
foreach($comments as $comment)
{ 
	if(isset($comment[$modelAlias]))
	{
		$comment = $comment[$modelAlias];
	}	
	$class = null;
	if ($i++ % 2 == 0)
	{
		$class = 'altrow';
	}
	if(isset($review) && $comment['poster_entity'] == 'User' && $comment['user_id'] == $review['Listing']['owner_id'])
	{
		$ownerComment = true;
		$class .=' owner_comment';
	}else
	{
		$ownerComment = false;
	}
?>
<div class="<?php echo $class;?> comment_box" id = "<?php echo $comment['id']?>">
 <span class="speech_tail"></span>
	<div class="post_info fl">
		<?php if($comment['poster_entity'] == 'Guest')
		{?>
			<?php echo $html->image($comment['poster']['avatar'],array('thumb'=>array('crop'=>true,'width'=>60,'height'=>60)));?>
			<?php echo $comment['poster']['display_name']; ?>
		<?php }else{?>
			<?php echo $html->link($html->image($comment['poster']['avatar'],array('class'=>"profile_pic",'thumb'=>array('crop'=>true,'width'=>60,'height'=>60))),$comment['poster']['profile_url'],array('escape'=>false));?>
			<?php echo $html->link($comment['poster']['display_name'], $comment['poster']['profile_url']); ?>
		<?php }?>
	</div>
	<div class="comment_body fl">
		<div class="time"><?php echo $time->timeAgoInwords($comment['created'],array('shortString'=>true));?></div><div class="clear"></div>
	<?php echo nl2br($comment['body']);?>
		<?php if($ownerComment){?>
	<div class="fr" style="opacity: .4">
		<?php echo __("Owner comment.");?>
	</div>
	<?php } ?>
	</div>
		<div class="clear"></div>
</div>
<?php } ?>
</div>